const common = require('./webpack.common.js')
const merge = require('webpack-merge')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const webpack = require('webpack')

module.exports = merge(common, {
  // mode: 'development',
  mode: 'none',
  plugins: [
    new CleanWebpackPlugin(),
    new CopyWebpackPlugin({
      patterns: ['public'],
    }),
    // 全局注入成员
    new webpack.DefinePlugin({
			// 全局注入一个API地址
			// API_BASE_URL: 'https://api.example.com',
      // value应是一个符合JS语法的代码片段
      // JSON.stringify()可以将一个具体的值转换成表示这个值的代码片段
			API_BASE_URL: JSON.stringify('https://api.example.com')
    }),
  ],
})
